package com.yuanfengerp.SalesOrder.controller;

import com.yuanfengerp.SalesOrder.model.NewOrders;
import com.yuanfengerp.SalesOrder.service.INewOrdersService;
import com.yuanfengerp.basicInfoManage.paymode.moudel.PayMethodInfo;
import com.yuanfengerp.goodsInfoManage.model.ProductManagement;
import com.yuanfengerp.publicUtil.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;

@RestController
@CrossOrigin
public class NewOrdersController {

    @Autowired
    private INewOrdersService inos;

    @PostMapping("/getProductManagement")
    public ArrayList<ProductManagement> getProductManagement(String warehouse_name,String pmName){
        return inos.getProductManagement(warehouse_name,pmName);
    }
    @PostMapping("/updateProductManagement")
    public Result<ProductManagement> updateProductManagement(@RequestBody ProductManagement productManagement){
        return inos.updateProductManagement(productManagement);
    }
    @PostMapping("/insertNewOrders")
    public Result<NewOrders> insertNewOrders(NewOrders newOrders){
        return inos.insertNewOrders(newOrders);
    }
    @PostMapping("/getPayMethodInfo")
    public ArrayList<PayMethodInfo> getPayMethodInfo(){
        return inos.getPayMethodInfo();
    }

}
